package leecode

func furthestDistanceFromOrigin(moves string) int {
	hashMap := make(map[byte]int)
	for i := 0; i < len(moves); i++ {
		hashMap[moves[i]]++
	}
	if hashMap['L'] >= hashMap['R'] {
		return hashMap['L'] + hashMap['_'] - hashMap['R']
	}
	return hashMap['R'] + hashMap['_'] - hashMap['L']
}
